package cn.tedu.spring.scope;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author lhd
 * @date 2024/4/17
 * @apiNote
 */
public class TestOrder {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext
                ("cn.tedu.spring.scope");

        //第一次获取
        Order order1 = context.getBean(Order.class);
        System.out.println(order1);

        //第二次获取
        Order order2 = context.getBean(Order.class);
        System.out.println(order2);
        /**
         * 运行结果
         * cn.tedu.spring.order.Order@a74868d
         * cn.tedu.spring.order.Order@a74868d
         */
    }
}
